import axios from 'axios'

const instance = axios.create()

instance.interceptors.request.use(config => {
  config.timeout = 10000
  // config.baseURL = 'https://api.iynn.cn/film'
  return config
})

instance.interceptors.response.use(
  res => res.data,
  err => Promise.reject(err)
)

export const get = (url, config = {}) => instance.get(url, config)
export const post = (url, data = {}, config = {}) => instance.post(url, data, config)
